<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>Docs For Class QPDB</title>
	<link rel="stylesheet" type="text/css" href="../../media/style.css">
	<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
	<script src="media/a.js"></script>
</head>
<body>

<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%">
  <tr>
	<td class="header-top-left"><img src="../../media/logo.png" border="0" alt="phpDocumentor " /></td>
    <td class="header-top-right">QueryPath<br /><div class="header-top-right-subpackage">Extension</div></td>
  </tr>
  <tr><td colspan="2" class="header-line"><img src="../../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
  <tr>
    <td colspan="2" class="header-menu">
      
                        
                                                  		[ <a href="../../classtrees_QueryPath.html" class="menu">class tree: QueryPath</a> ]
		[ <a href="../../elementindex_QueryPath.html" class="menu">index: QueryPath</a> ]
            [ <a href="../../elementindex.html" class="menu">all elements</a> ]
    </td>
  </tr>
  <tr><td colspan="2" class="header-line"><img src="../../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="195" class="menu">
		<div class="package-title">QueryPath</div>
  <div class="package">
	<div id="todolist">
			<p><a href="../../todolist.html">Todo List</a></p>
	</div>
	</div>
      <b>Packages:</b><br />
  <div class="package">
              <a href="../../li_QueryPath.html">QueryPath</a><br />
              <a href="../../li_Examples.html">Examples</a><br />
              <a href="../../li_Tests.html">Tests</a><br />
      	</div>
      <br />
		<b>Tutorials/Manuals:</b><br />
  <div class="package">
					<strong>Package-level:</strong>
							<ul>
	<li type="square"><a href="../../QueryPath/tutorial_QueryPath.pkg.html">Using QueryPath</a>
</ul>

									                        <b>Files:</b><br />
        <div class="package">
				<span style="padding-left: 1em;"><a href="../../QueryPath/_src---QueryPath---QueryPath.php.html">QueryPath.php</a></span><br />
			<span style="padding-left: 1em;"><a href="../../QueryPath/_src---QueryPath---QueryPathExtension.php.html">QueryPathExtension.php</a></span><br />
	  </div>
  <div class="package">
	<strong>CSSParser</strong><br />			<span style="padding-left: 1em;"><a href="../../QueryPath/CSSParser/_src---QueryPath---CssEventHandler.php.html">CssEventHandler.php</a></span><br />
			<span style="padding-left: 1em;"><a href="../../QueryPath/CSSParser/_src---QueryPath---CssParser.php.html">CssParser.php</a></span><br />
	  </div>
  <div class="package">
	<strong>Extension</strong><br />			<span style="padding-left: 1em;"><a href="../../QueryPath/Extension/_src---QueryPath---Extension---QPDB.php.html">QPDB.php</a></span><br />
			<span style="padding-left: 1em;"><a href="../../QueryPath/Extension/_src---QueryPath---Extension---QPList.php.html">QPList.php</a></span><br />
			<span style="padding-left: 1em;"><a href="../../QueryPath/Extension/_src---QueryPath---Extension---QPTPL.php.html">QPTPL.php</a></span><br />
			<span style="padding-left: 1em;"><a href="../../QueryPath/Extension/_src---QueryPath---Extension---QPXML.php.html">QPXML.php</a></span><br />
	  </div>
  <div class="package">
	<strong>Internals</strong><br />			<span style="padding-left: 1em;"><a href="../../QueryPath/Internals/_src---QueryPath---QueryPathImpl.php.html">QueryPathImpl.php</a></span><br />
	  </div>
            <br />
            <b>Interfaces:</b><br />
        <div class="package">
	CSSParser<br />	    <span style="padding-left: 1em;">		<a href="../../QueryPath/CSSParser/CssEventHandler.html">CssEventHandler</a>    </span>	 <br />
	  </div>
  <div class="package">
	Extension<br />	    <span style="padding-left: 1em;">		<a href="../../QueryPath/Extension/TableAble.html">TableAble</a>    </span>	 <br />
	  </div>
  <div class="package">
		    		<a href="../../QueryPath/QueryPath.html">QueryPath</a>    	 <br />
	    		<a href="../../QueryPath/QueryPathExtension.html">QueryPathExtension</a>    	 <br />
	  </div>
                  <b>Classes:</b><br />
        <div class="package">
	CSSParser<br />	    <span style="padding-left: 1em;">		<a href="../../QueryPath/CSSParser/CssInputStream.html">CssInputStream</a>    </span>	 <br />
	    <span style="padding-left: 1em;">		<a href="../../QueryPath/CSSParser/CSSParseException.html">CSSParseException</a>    </span>	 <br />
	    <span style="padding-left: 1em;">		<a href="../../QueryPath/CSSParser/CssParser.html">CssParser</a>    </span>	 <br />
	    <span style="padding-left: 1em;">		<a href="../../QueryPath/CSSParser/CssScanner.html">CssScanner</a>    </span>	 <br />
	    <span style="padding-left: 1em;">		<a href="../../QueryPath/CSSParser/CssToken.html">CssToken</a>    </span>	 <br />
	    <span style="padding-left: 1em;">		<a href="../../QueryPath/CSSParser/NamespaceMap.html">NamespaceMap</a>    </span>	 <br />
	    <span style="padding-left: 1em;">		<a href="../../QueryPath/CSSParser/NegationCssEventHandler.html">NegationCssEventHandler</a>    </span>	 <br />
	    <span style="padding-left: 1em;">		<a href="../../QueryPath/CSSParser/NotImplementedException.html">NotImplementedException</a>    </span>	 <br />
	    <span style="padding-left: 1em;">		<a href="../../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a>    </span>	 <br />
	    <span style="padding-left: 1em;">		<a href="../../QueryPath/CSSParser/UniqueElementList.html">UniqueElementList</a>    </span>	 <br />
	  </div>
  <div class="package">
	Extension<br />	    <span style="padding-left: 1em;">		<a href="../../QueryPath/Extension/QPDB.html">QPDB</a>    </span>	 <br />
	    <span style="padding-left: 1em;">		<a href="../../QueryPath/Extension/QPList.html">QPList</a>    </span>	 <br />
	    <span style="padding-left: 1em;">		<a href="../../QueryPath/Extension/QPTableData.html">QPTableData</a>    </span>	 <br />
	    <span style="padding-left: 1em;">		<a href="../../QueryPath/Extension/QPTableTextData.html">QPTableTextData</a>    </span>	 <br />
	    <span style="padding-left: 1em;">		<a href="../../QueryPath/Extension/QPTPL.html">QPTPL</a>    </span>	 <br />
	    <span style="padding-left: 1em;">		<a href="../../QueryPath/Extension/QPXML.html">QPXML</a>    </span>	 <br />
	  </div>
  <div class="package">
		    		<a href="../../QueryPath/QueryPathException.html">QueryPathException</a>    	 <br />
	    		<a href="../../QueryPath/QueryPathExtensionRegistry.html">QueryPathExtensionRegistry</a>    	 <br />
	  </div>
  <div class="package">
	Internals<br />	    <span style="padding-left: 1em;">		<a href="../../QueryPath/Internals/QueryPathImpl.html">QueryPathImpl</a>    </span>	 <br />
	    <span style="padding-left: 1em;">		<a href="../../QueryPath/Internals/QueryPathIterator.html">QueryPathIterator</a>    </span>	 <br />
	  </div>
                </td>
    <td>
      <table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top">

<h1>Class: QPDB</h1>
Source Location: /src/QueryPath/Extension/QPDB.php<br /><br />

<h2 class="class-name">Class QPDB</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Class Overview</div>
	<div class="nav-bar">
					<span class="disabled">Class Overview</span>
						
											| <a href="#sec-var-summary">Property Summary</a> | <a href="#sec-vars">Properties Detail</a>
														| <a href="#sec-method-summary">Method Summary</a> | <a href="#sec-methods">Methods Detail</a>
								</div>
	<div class="info-box-body">
		<table width="100%" border="0">
		<tr><td valign="top" width="60%" class="class-overview">

                <p class="implements">
            Implements interfaces:
            <ul>
                <li><a href="../../QueryPath/QueryPathExtension.html">QueryPathExtension</a></li>            </ul>
        </p>
        		<p align="center" class="short-description"><strong>Provide DB access to a QueryPath object.
</strong></p>
<span class="description"><p>This extension provides tools for communicating with a database using the  QueryPath library. It relies upon PDO for underlying database communiction. This  means that it supports all databases that PDO supports, including MySQL,  PostgreSQL, and SQLite.</p><p>Here is an extended example taken from the unit tests for this library.</p><p>Let's say we create a database with code like this:  <ol><li><div class="src-line"><span class="src-php">&lt;?php</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><span class="src-id">setUp</span><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id"><a href="../../QueryPath/Extension/QPDB.html#var$db">db</a>&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">PDO</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id"><a href="../../QueryPath/Extension/QPDB.html#var$dsn">dsn</a></span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id"><a href="../../QueryPath/Extension/QPDB.html#var$db">db</a></span><span class="src-sym">-&gt;</span><span class="src-id">setAttribute</span><span class="src-sym">(</span><span class="src-id">PDO</span><span class="src-sym">::</span><span class="src-id">ATTR_ERRMODE</span><span class="src-sym">,&nbsp;</span><span class="src-id">PDO</span><span class="src-sym">::</span><span class="src-id">ERRMODE_EXCEPTION</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id"><a href="../../QueryPath/Extension/QPDB.html#var$db">db</a></span><span class="src-sym">-&gt;</span><a href="../../QueryPath/Extension/QPDB.html#methodexec">exec</a><span class="src-sym">(</span><span class="src-str">'CREATE&nbsp;TABLE&nbsp;IF&nbsp;NOT&nbsp;EXISTS&nbsp;qpdb_test&nbsp;(colOne,&nbsp;colTwo,&nbsp;colThree)'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-var">$stmt&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id"><a href="../../QueryPath/Extension/QPDB.html#var$db">db</a></span><span class="src-sym">-&gt;</span><span class="src-id">prepare</span><span class="src-sym">(</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'INSERT&nbsp;INTO&nbsp;qpdb_test&nbsp;(colOne,&nbsp;colTwo,&nbsp;colThree)&nbsp;VALUES&nbsp;(:one,&nbsp;:two,&nbsp;:three)'</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-key">for&nbsp;</span><span class="src-sym">(</span><span class="src-var">$i&nbsp;</span>=&nbsp;<span class="src-num">0</span><span class="src-sym">;&nbsp;</span><span class="src-var">$i&nbsp;</span>&lt;&nbsp;<span class="src-num">5</span><span class="src-sym">;&nbsp;</span>++<span class="src-var">$i</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$vals&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">':one'&nbsp;</span>=&gt;&nbsp;<span class="src-str">'Title&nbsp;'&nbsp;</span>.&nbsp;<span class="src-var">$i</span><span class="src-sym">,&nbsp;</span><span class="src-str">':two'&nbsp;</span>=&gt;&nbsp;<span class="src-str">'Body&nbsp;'&nbsp;</span>.&nbsp;<span class="src-var">$i</span><span class="src-sym">,&nbsp;</span><span class="src-str">':three'&nbsp;</span>=&gt;&nbsp;<span class="src-str">'Footer&nbsp;'&nbsp;</span>.&nbsp;<span class="src-var">$i</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stmt</span><span class="src-sym">-&gt;</span><span class="src-id">execute</span><span class="src-sym">(</span><span class="src-var">$vals</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stmt</span><span class="src-sym">-&gt;</span><span class="src-id">closeCursor</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-php">?&gt;</span></div></li>
</ol></p><p>From QueryPath with QPDB, we can now do very elaborate DB chains like this: <ol><li><div class="src-line">&nbsp;<span class="src-php">&lt;?php</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$sql&nbsp;</span>=&nbsp;<span class="src-str">'SELECT&nbsp;*&nbsp;FROM&nbsp;qpdb_test'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$args&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$qp&nbsp;</span>=&nbsp;<a href="../../QueryPath/_src---QueryPath---QueryPath.php.html#functionqp">qp</a><span class="src-sym">(</span><span class="src-id"><a href="../../QueryPath/QueryPath.html">QueryPath</a></span><span class="src-sym">::</span><span class="src-id">HTML_STUB</span><span class="src-sym">,&nbsp;</span><span class="src-str">'body'</span><span class="src-sym">)&nbsp;</span><span class="src-comm">//&nbsp;Open&nbsp;a&nbsp;stub&nbsp;HTML&nbsp;doc&nbsp;and&nbsp;select&nbsp;&lt;body/&gt;</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">append</span><span class="src-sym">(</span><span class="src-str">'&lt;h1&gt;&lt;/h1&gt;'</span><span class="src-sym">)&nbsp;</span><span class="src-comm">//&nbsp;Add&nbsp;&lt;h1/&gt;</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">children</span><span class="src-sym">(</span><span class="src-sym">)&nbsp;&nbsp;</span><span class="src-comm">//&nbsp;Select&nbsp;the&nbsp;&lt;h1/&gt;</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><a href="../../QueryPath/Extension/QPDB.html#methoddbInit">dbInit</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id"><a href="../../QueryPath/Extension/QPDB.html#var$dsn">dsn</a></span><span class="src-sym">)&nbsp;</span><span class="src-comm">//&nbsp;Connect&nbsp;to&nbsp;the&nbsp;database</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><a href="../../QueryPath/Extension/QPDB.html#methodquery">query</a><span class="src-sym">(</span><span class="src-var">$sql</span><span class="src-sym">,&nbsp;</span><span class="src-var">$args</span><span class="src-sym">)&nbsp;</span><span class="src-comm">//&nbsp;Execute&nbsp;the&nbsp;SQL&nbsp;query</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><a href="../../QueryPath/Extension/QPDB.html#methodnextRow">nextRow</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;&nbsp;</span><span class="src-comm">//&nbsp;Select&nbsp;a&nbsp;row.&nbsp;By&nbsp;default,&nbsp;no&nbsp;row&nbsp;is&nbsp;selected.</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><a href="../../QueryPath/Extension/QPDB.html#methodappendColumn">appendColumn</a><span class="src-sym">(</span><span class="src-str">'colOne'</span><span class="src-sym">)&nbsp;</span><span class="src-comm">//&nbsp;Append&nbsp;Row&nbsp;1,&nbsp;Col&nbsp;1&nbsp;(Title&nbsp;0)</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">parent</span><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-comm">//&nbsp;Go&nbsp;back&nbsp;to&nbsp;the&nbsp;&lt;body/&gt;</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">append</span><span class="src-sym">(</span><span class="src-str">'&lt;p/&gt;'</span><span class="src-sym">)&nbsp;</span><span class="src-comm">//&nbsp;Append&nbsp;a&nbsp;&lt;p/&gt;&nbsp;to&nbsp;the&nbsp;body</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'p'</span><span class="src-sym">)&nbsp;&nbsp;</span><span class="src-comm">//&nbsp;Find&nbsp;the&nbsp;&lt;p/&gt;&nbsp;we&nbsp;just&nbsp;created.</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><a href="../../QueryPath/Extension/QPDB.html#methodnextRow">nextRow</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-comm">//&nbsp;Advance&nbsp;to&nbsp;row&nbsp;2</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><a href="../../QueryPath/Extension/QPDB.html#methodprependColumn">prependColumn</a><span class="src-sym">(</span><span class="src-str">'colTwo'</span><span class="src-sym">)&nbsp;</span><span class="src-comm">//&nbsp;Get&nbsp;row&nbsp;2,&nbsp;col&nbsp;2.&nbsp;(Body&nbsp;1)</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><a href="../../QueryPath/Extension/QPDB.html#methodcolumnAfter">columnAfter</a><span class="src-sym">(</span><span class="src-str">'colThree'</span><span class="src-sym">)&nbsp;</span><span class="src-comm">//&nbsp;Get&nbsp;row&nbsp;2&nbsp;col&nbsp;3.&nbsp;(Footer&nbsp;1)</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><a href="../../QueryPath/Extension/QPDB.html#methoddoneWithQuery">doneWithQuery</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-comm">//&nbsp;Let&nbsp;QueryPath&nbsp;clean&nbsp;up.&nbsp;YOU&nbsp;SHOULD&nbsp;ALWAYS&nbsp;DO&nbsp;THIS.</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">writeHTML</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-comm">//&nbsp;Write&nbsp;the&nbsp;output&nbsp;as&nbsp;HTML.</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-php">?&gt;</span></div></li>
</ol>  With the code above, we step through the document, selectively building elements  as we go, and then populating this elements with data from our initial query.</p><p>When the last command, QueryPath:::writeHTML(), is run, we will get output  like this:  <ol><li><div class="src-line">&nbsp;&nbsp;&nbsp;&lt;<span class="src-sym">!</span><span class="src-id">DOCTYPE&nbsp;html&nbsp;</span><span class="src-key">PUBLIC&nbsp;</span><span class="src-str">&quot;-//W3C//DTD&nbsp;XHTML&nbsp;1.0&nbsp;Strict//EN&quot;&nbsp;&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;</span>&gt;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&lt;<span class="src-id">html&nbsp;xmlns</span>=<span class="src-str">&quot;http://www.w3.org/1999/xhtml&quot;</span>&gt;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;<span class="src-id">head</span>&gt;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;<span class="src-id">meta&nbsp;http</span>-<span class="src-id">equiv</span>=<span class="src-str">&quot;Content-Type&quot;&nbsp;</span><span class="src-id">content</span>=<span class="src-str">&quot;text/html;&nbsp;charset=utf-8&quot;&nbsp;</span>/&gt;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;<span class="src-id">title</span>&gt;<span class="src-id">Untitled</span>&lt;/<span class="src-id">title</span>&gt;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/<span class="src-id">head</span>&gt;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;<span class="src-id">body</span>&gt;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;<span class="src-id">h1</span>&gt;<span class="src-id">Title&nbsp;</span><span class="src-num">0</span>&lt;/<span class="src-id">h1</span>&gt;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;<span class="src-id">p</span>&gt;<span class="src-id">Body&nbsp;</span><span class="src-num">1</span>&lt;/<span class="src-id">p</span>&gt;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">Footer&nbsp;</span><span class="src-num">1</span>&lt;/<span class="src-id">body</span>&gt;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&lt;/<span class="src-id">html</span>&gt;</div></li>
</ol>  Notice the body section in particular. This is where the data has been  inserted.</p><p>Sometimes you want to do something a lot simpler, like give QueryPath a  template and have it navigate a query, inserting the data into a template, and  then inserting the template into the document. This can be done simply with  the <a href="../../QueryPath/Extension/QPDB.html#methodqueryInto">queryInto()</a> function.</p><p>Here's an example from another unit test:  <ol><li><div class="src-line">&nbsp;<span class="src-php">&lt;?php</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$template&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;?&gt;&lt;li&nbsp;class=&quot;colOne&quot;/&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$sql&nbsp;</span>=&nbsp;<span class="src-str">'SELECT&nbsp;*&nbsp;FROM&nbsp;qpdb_test'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$args&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$qp&nbsp;</span>=&nbsp;<a href="../../QueryPath/_src---QueryPath---QueryPath.php.html#functionqp">qp</a><span class="src-sym">(</span><span class="src-id"><a href="../../QueryPath/QueryPath.html">QueryPath</a></span><span class="src-sym">::</span><span class="src-id">HTML_STUB</span><span class="src-sym">,&nbsp;</span><span class="src-str">'body'</span><span class="src-sym">)</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">append</span><span class="src-sym">(</span><span class="src-str">'&lt;ul/&gt;'</span><span class="src-sym">)&nbsp;</span><span class="src-comm">//&nbsp;Add&nbsp;a&nbsp;new&nbsp;&lt;ul/&gt;</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">children</span><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-comm">//&nbsp;Select&nbsp;the&nbsp;&lt;ul/&gt;</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><a href="../../QueryPath/Extension/QPDB.html#methoddbInit">dbInit</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id"><a href="../../QueryPath/Extension/QPDB.html#var$dsn">dsn</a></span><span class="src-sym">)&nbsp;</span><span class="src-comm">//&nbsp;Initialize&nbsp;the&nbsp;DB</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;BIG&nbsp;LINE:&nbsp;Query&nbsp;the&nbsp;results,&nbsp;run&nbsp;them&nbsp;through&nbsp;the&nbsp;template,&nbsp;and&nbsp;insert&nbsp;them.</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><a href="../../QueryPath/Extension/QPDB.html#methodqueryInto">queryInto</a><span class="src-sym">(</span><span class="src-var">$sql</span><span class="src-sym">,&nbsp;</span><span class="src-var">$args</span><span class="src-sym">,&nbsp;</span><span class="src-var">$template</span><span class="src-sym">)</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><a href="../../QueryPath/Extension/QPDB.html#methoddoneWithQuery">doneWithQuery</a><span class="src-sym">(</span><span class="src-sym">)</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">writeHTML</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-comm">//&nbsp;Write&nbsp;the&nbsp;results&nbsp;as&nbsp;HTML.</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-php">?&gt;</span></div></li>
</ol>  The simple code above puts the first column of the select statement  into an unordered list. The example output looks like this:  <ol><li><div class="src-line">&nbsp;&lt;<span class="src-sym">!</span><span class="src-id">DOCTYPE&nbsp;html&nbsp;</span><span class="src-key">PUBLIC&nbsp;</span><span class="src-str">&quot;-//W3C//DTD&nbsp;XHTML&nbsp;1.0&nbsp;Strict//EN&quot;&nbsp;&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;</span>&gt;</div></li>
<li><div class="src-line">&nbsp;&lt;<span class="src-id">html&nbsp;xmlns</span>=<span class="src-str">&quot;http://www.w3.org/1999/xhtml&quot;</span>&gt;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&lt;<span class="src-id">head</span>&gt;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;<span class="src-id">meta&nbsp;http</span>-<span class="src-id">equiv</span>=<span class="src-str">&quot;Content-Type&quot;&nbsp;</span><span class="src-id">content</span>=<span class="src-str">&quot;text/html;&nbsp;charset=utf-8&quot;</span>&gt;&lt;/<span class="src-id">meta</span>&gt;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;<span class="src-id">title</span>&gt;<span class="src-id">Untitled</span>&lt;/<span class="src-id">title</span>&gt;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&lt;/<span class="src-id">head</span>&gt;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&lt;<span class="src-id">body</span>&gt;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&lt;<span class="src-id">ul</span>&gt;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&lt;<span class="src-id">li&nbsp;</span><span class="src-key">class</span>=<span class="src-str">&quot;colOne&quot;</span>&gt;<span class="src-id">Title&nbsp;</span><span class="src-num">0</span>&lt;/<span class="src-id">li</span>&gt;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&lt;<span class="src-id">li&nbsp;</span><span class="src-key">class</span>=<span class="src-str">&quot;colOne&quot;</span>&gt;<span class="src-id">Title&nbsp;</span><span class="src-num">1</span>&lt;/<span class="src-id">li</span>&gt;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&lt;<span class="src-id">li&nbsp;</span><span class="src-key">class</span>=<span class="src-str">&quot;colOne&quot;</span>&gt;<span class="src-id">Title&nbsp;</span><span class="src-num">2</span>&lt;/<span class="src-id">li</span>&gt;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&lt;<span class="src-id">li&nbsp;</span><span class="src-key">class</span>=<span class="src-str">&quot;colOne&quot;</span>&gt;<span class="src-id">Title&nbsp;</span><span class="src-num">3</span>&lt;/<span class="src-id">li</span>&gt;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&lt;<span class="src-id">li&nbsp;</span><span class="src-key">class</span>=<span class="src-str">&quot;colOne&quot;</span>&gt;<span class="src-id">Title&nbsp;</span><span class="src-num">4</span>&lt;/<span class="src-id">li</span>&gt;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&lt;/<span class="src-id">ul</span>&gt;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&lt;/<span class="src-id">body</span>&gt;</div></li>
<li><div class="src-line">&nbsp;&lt;/<span class="src-id">html</span>&gt;</div></li>
</ol></p><p>Typical starting methods for this class are <a href="../../QueryPath/Extension/QPDB.html#methodbaseDB">QPDB::baseDB()</a>,  <a href="../../QueryPath/Extension/QPDB.html#methodquery">QPDB::query()</a>, and <a href="../../QueryPath/Extension/QPDB.html#methodqueryInto">QPDB::queryInto()</a>.</p></span>
		<p class="notes">
			Located in <a class="field" href="_src---QueryPath---Extension---QPDB.php.html">/src/QueryPath/Extension/QPDB.php</a> [<span class="field">line <a href="../../__filesource/fsource_QueryPath_Extension_srcQueryPathExtensionQPDB.php.html#a227">227</a></span>]
		</p>

		
		<pre></pre>

		
		
		
		</td>

				<td valign="top" width="20%" class="class-overview">
		<p align="center" class="short-description"><strong><a href="#sec_vars">Properties</a></strong></p>
		<ul>
		  		  <li><a href="../../QueryPath/Extension/QPDB.html#var$con">$con</a></li>
		  		  <li><a href="../../QueryPath/Extension/QPDB.html#var$cycleRows">$cycleRows</a></li>
		  		  <li><a href="../../QueryPath/Extension/QPDB.html#var$db">$db</a></li>
		  		  <li><a href="../../QueryPath/Extension/QPDB.html#var$dsn">$dsn</a></li>
		  		  <li><a href="../../QueryPath/Extension/QPDB.html#var$opts">$opts</a></li>
		  		  <li><a href="../../QueryPath/Extension/QPDB.html#var$qp">$qp</a></li>
		  		  <li><a href="../../QueryPath/Extension/QPDB.html#var$row">$row</a></li>
		  		  <li><a href="../../QueryPath/Extension/QPDB.html#var$stmt">$stmt</a></li>
		  		</ul>
		</td>
		
				<td valign="top" width="20%" class="class-overview">
		<p align="center" class="short-description"><strong><a href="#sec_methods">Methods</a></strong></p>
		<ul>
		  		  <li><a href="../../QueryPath/Extension/QPDB.html#method__construct">__construct</a></li>
		  		  <li><a href="../../QueryPath/Extension/QPDB.html#methodaddData">addData</a></li>
		  		  <li><a href="../../QueryPath/Extension/QPDB.html#methodappendColumn">appendColumn</a></li>
		  		  <li><a href="../../QueryPath/Extension/QPDB.html#methodbaseDB">baseDB</a></li>
		  		  <li><a href="../../QueryPath/Extension/QPDB.html#methodcolumnAfter">columnAfter</a></li>
		  		  <li><a href="../../QueryPath/Extension/QPDB.html#methodcolumnBefore">columnBefore</a></li>
		  		  <li><a href="../../QueryPath/Extension/QPDB.html#methoddbInit">dbInit</a></li>
		  		  <li><a href="../../QueryPath/Extension/QPDB.html#methoddoneWithQuery">doneWithQuery</a></li>
		  		  <li><a href="../../QueryPath/Extension/QPDB.html#methodexec">exec</a></li>
		  		  <li><a href="../../QueryPath/Extension/QPDB.html#methodgetBaseDB">getBaseDB</a></li>
		  		  <li><a href="../../QueryPath/Extension/QPDB.html#methodgetStatement">getStatement</a></li>
		  		  <li><a href="../../QueryPath/Extension/QPDB.html#methodnextRow">nextRow</a></li>
		  		  <li><a href="../../QueryPath/Extension/QPDB.html#methodprependColumn">prependColumn</a></li>
		  		  <li><a href="../../QueryPath/Extension/QPDB.html#methodquery">query</a></li>
		  		  <li><a href="../../QueryPath/Extension/QPDB.html#methodqueryInto">queryInto</a></li>
		  		  <li><a href="../../QueryPath/Extension/QPDB.html#methodwithEachRow">withEachRow</a></li>
		  		</ul>
		</td>
		
		</tr></table>
		<div class="top">[ <a href="#top">Top</a> ]</div>
	</div>
</div>




	<a name="sec-var-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Property Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Class Overview</a>
									| <span class="disabled">Property Summary</span> | <a href="#sec-vars">Properties Detail</a>
												| <a href="#sec-method-summary">Method Summary</a> | <a href="#sec-methods">Methods Detail</a>
							    				</div>
		<div class="info-box-body">
			<div class="var-summary">
			<table border="0" cellspacing="0" cellpadding="0" class="var-summary">
										<div class="var-title">
					<tr><td class="var-title">static <span class="var-type-summary">mixed</span>&nbsp;&nbsp;</td>
					<td class="var-title"><a href="#$con" title="details" class="var-name-summary">$con</a>&nbsp;&nbsp;</td>
					<td class="var-summary-description"></td></tr>
				</div>
																																																																<div class="var-title">
					<tr><td class="var-title"><span class="var-type-summary">mixed</span>&nbsp;&nbsp;</td>
					<td class="var-title"><a href="#$cycleRows" title="details" class="var-name-summary">$cycleRows</a>&nbsp;&nbsp;</td>
					<td class="var-summary-description">Used to control whether or not all rows in a result should be cycled through.</td></tr>
				</div>
													<div class="var-title">
					<tr><td class="var-title"><span class="var-type-summary">mixed</span>&nbsp;&nbsp;</td>
					<td class="var-title"><a href="#$db" title="details" class="var-name-summary">$db</a>&nbsp;&nbsp;</td>
					<td class="var-summary-description"></td></tr>
				</div>
													<div class="var-title">
					<tr><td class="var-title"><span class="var-type-summary">mixed</span>&nbsp;&nbsp;</td>
					<td class="var-title"><a href="#$dsn" title="details" class="var-name-summary">$dsn</a>&nbsp;&nbsp;</td>
					<td class="var-summary-description"></td></tr>
				</div>
													<div class="var-title">
					<tr><td class="var-title"><span class="var-type-summary">mixed</span>&nbsp;&nbsp;</td>
					<td class="var-title"><a href="#$opts" title="details" class="var-name-summary">$opts</a>&nbsp;&nbsp;</td>
					<td class="var-summary-description"></td></tr>
				</div>
													<div class="var-title">
					<tr><td class="var-title"><span class="var-type-summary">mixed</span>&nbsp;&nbsp;</td>
					<td class="var-title"><a href="#$qp" title="details" class="var-name-summary">$qp</a>&nbsp;&nbsp;</td>
					<td class="var-summary-description"></td></tr>
				</div>
													<div class="var-title">
					<tr><td class="var-title"><span class="var-type-summary">mixed</span>&nbsp;&nbsp;</td>
					<td class="var-title"><a href="#$row" title="details" class="var-name-summary">$row</a>&nbsp;&nbsp;</td>
					<td class="var-summary-description"></td></tr>
				</div>
													<div class="var-title">
					<tr><td class="var-title"><span class="var-type-summary">mixed</span>&nbsp;&nbsp;</td>
					<td class="var-title"><a href="#$stmt" title="details" class="var-name-summary">$stmt</a>&nbsp;&nbsp;</td>
					<td class="var-summary-description"></td></tr>
				</div>
										</table>
			</div>
			<br /><div class="top">[ <a href="#top">Top</a> ]</div>
		</div>
	</div>

	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Class Overview</a>
																		| <a href="#sec-var-summary">Property Summary</a> | <a href="#sec-vars">Properties Detail</a>
							    					| <span class="disabled">Method Summary</span> | <a href="#sec-methods">Methods Detail</a>
		</div>
		<div class="info-box-body">
			<div class="method-summary">
				<table border="0" cellspacing="0" cellpadding="0" class="method-summary">
																																				<div class="method-definition">
					<tr><td class="method-definition">static
											<span class="method-result">void</span>&nbsp;&nbsp;
					</td>
					<td class="method-definition"><a href="#baseDB" title="details" class="method-name">baseDB</a>()&nbsp;&nbsp;</td>
					<td class="method-definition">Create a new database instance for all QueryPath objects to share.</td></tr>
				</div>
																																																								<div class="method-definition">
					<tr><td class="method-definition">static
											<span class="method-result">void</span>&nbsp;&nbsp;
					</td>
					<td class="method-definition"><a href="#getBaseDB" title="details" class="method-name">getBaseDB</a>()&nbsp;&nbsp;</td>
					<td class="method-definition">This method may be used to share the connection with other,  non-QueryPath objects.</td></tr>
				</div>
																																																																				<div class="method-definition">
											<tr><td class="method-definition"><span class="method-result">QPDB</span>&nbsp;&nbsp;</td>
										<td class="method-definition"><a href="#__construct" title="details" class="method-name">__construct</a>()&nbsp;&nbsp;</td>
					<td class="method-definition">Construct a new QPDB object. This is usually done by QueryPath itself.</td></tr>
				</div>
																<div class="method-definition">
											<tr><td class="method-definition"><span class="method-result">void</span>&nbsp;&nbsp;</td>
										<td class="method-definition"><a href="#addData" title="details" class="method-name">addData</a>()&nbsp;&nbsp;</td>
					<td class="method-definition">This is the implementation behind the append/prepend and before/after methods.</td></tr>
				</div>
																<div class="method-definition">
											<tr><td class="method-definition"><span class="method-result">void</span>&nbsp;&nbsp;</td>
										<td class="method-definition"><a href="#appendColumn" title="details" class="method-name">appendColumn</a>()&nbsp;&nbsp;</td>
					<td class="method-definition">Append the data in the given column(s) to the QueryPath.</td></tr>
				</div>
																								<div class="method-definition">
											<tr><td class="method-definition"><span class="method-result">void</span>&nbsp;&nbsp;</td>
										<td class="method-definition"><a href="#columnAfter" title="details" class="method-name">columnAfter</a>()&nbsp;&nbsp;</td>
					<td class="method-definition">Insert data from the given column(s) after each element in the QueryPath.</td></tr>
				</div>
																<div class="method-definition">
											<tr><td class="method-definition"><span class="method-result">void</span>&nbsp;&nbsp;</td>
										<td class="method-definition"><a href="#columnBefore" title="details" class="method-name">columnBefore</a>()&nbsp;&nbsp;</td>
					<td class="method-definition">Insert the data from the given column before each element in the QueryPath.</td></tr>
				</div>
																<div class="method-definition">
											<tr><td class="method-definition"><span class="method-result"><a href="../../QueryPath/QueryPath.html">QueryPath</a></span>&nbsp;&nbsp;</td>
										<td class="method-definition"><a href="#dbInit" title="details" class="method-name">dbInit</a>()&nbsp;&nbsp;</td>
					<td class="method-definition">Create a new connection to the database. Use the PDO DSN syntax for a  connection string.</td></tr>
				</div>
																<div class="method-definition">
											<tr><td class="method-definition"><span class="method-result"><a href="../../QueryPath/QueryPath.html">QueryPath</a></span>&nbsp;&nbsp;</td>
										<td class="method-definition"><a href="#doneWithQuery" title="details" class="method-name">doneWithQuery</a>()&nbsp;&nbsp;</td>
					<td class="method-definition">Free up resources when a query is no longer used.</td></tr>
				</div>
																<div class="method-definition">
											<tr><td class="method-definition"><span class="method-result">void</span>&nbsp;&nbsp;</td>
										<td class="method-definition"><a href="#exec" title="details" class="method-name">exec</a>()&nbsp;&nbsp;</td>
					<td class="method-definition">Execute a SQL query, but expect no value.</td></tr>
				</div>
																								<div class="method-definition">
											<tr><td class="method-definition"><span class="method-result">PDOStatement</span>&nbsp;&nbsp;</td>
										<td class="method-definition"><a href="#getStatement" title="details" class="method-name">getStatement</a>()&nbsp;&nbsp;</td>
					<td class="method-definition">Get back the raw PDOStatement object after a query().</td></tr>
				</div>
																<div class="method-definition">
											<tr><td class="method-definition"><span class="method-result"><a href="../../QueryPath/QueryPath.html">QueryPath</a></span>&nbsp;&nbsp;</td>
										<td class="method-definition"><a href="#nextRow" title="details" class="method-name">nextRow</a>()&nbsp;&nbsp;</td>
					<td class="method-definition">Advance the query results row cursor.</td></tr>
				</div>
																<div class="method-definition">
											<tr><td class="method-definition"><span class="method-result">void</span>&nbsp;&nbsp;</td>
										<td class="method-definition"><a href="#prependColumn" title="details" class="method-name">prependColumn</a>()&nbsp;&nbsp;</td>
					<td class="method-definition">Prepend the data from the given column into the QueryPath.</td></tr>
				</div>
																<div class="method-definition">
											<tr><td class="method-definition"><span class="method-result">void</span>&nbsp;&nbsp;</td>
										<td class="method-definition"><a href="#query" title="details" class="method-name">query</a>()&nbsp;&nbsp;</td>
					<td class="method-definition">Execute a SQL query, and store the results.</td></tr>
				</div>
																<div class="method-definition">
											<tr><td class="method-definition"><span class="method-result">void</span>&nbsp;&nbsp;</td>
										<td class="method-definition"><a href="#queryInto" title="details" class="method-name">queryInto</a>()&nbsp;&nbsp;</td>
					<td class="method-definition">Query and append the results.</td></tr>
				</div>
																<div class="method-definition">
											<tr><td class="method-definition"><span class="method-result"><a href="../../QueryPath/QueryPath.html">QueryPath</a></span>&nbsp;&nbsp;</td>
										<td class="method-definition"><a href="#withEachRow" title="details" class="method-name">withEachRow</a>()&nbsp;&nbsp;</td>
					<td class="method-definition">Set the object to use each row, instead of only one row.</td></tr>
				</div>
												</table>
			</div>
			<br /><div class="top">[ <a href="#top">Top</a> ]</div>
		</div>
	</div>

	<a name="sec-vars"></a>
	<div class="info-box">
		<div class="info-box-title">Properties</div>
		<div class="nav-bar">
			<a href="#sec-description">Class Overview</a>
													| <a href="#sec-var-summary">Property Summary</a> | <span class="disabled">Properties Detail</span>
															| <a href="#sec-method-summary">Method Summary</a> | <a href="#sec-methods">Methods Detail</a>
												</div>
		<div class="info-box-body">
			<a name="var$con" id="$con"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			static <span class="var-type">mixed</span>&nbsp;&nbsp;
			<span class="var-name">$con</span>
			 = <span class="var-default"> NULL</span>			<span class="smalllinenumber">[line <a href="../../__filesource/fsource_QueryPath_Extension_srcQueryPathExtensionQPDB.php.html#a235">235</a>]</span>
		</span>
	</div>

		<strong>API Tags:</strong><br />
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="indent"><strong>Access:</strong>&nbsp;&nbsp;</td><td>protected</td>
  </tr>
</table>
<br />


	
		<br />
	<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<a name="var$cycleRows" id="$cycleRows"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">mixed</span>&nbsp;&nbsp;
			<span class="var-name">$cycleRows</span>
			 = <span class="var-default"> FALSE</span>			<span class="smalllinenumber">[line <a href="../../__filesource/fsource_QueryPath_Extension_srcQueryPathExtensionQPDB.php.html#a299">299</a>]</span>
		</span>
	</div>

	<p align="center" class="short-description"><strong>Used to control whether or not all rows in a result should be cycled through.
</strong></p>
	<strong>API Tags:</strong><br />
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="indent"><strong>Access:</strong>&nbsp;&nbsp;</td><td>protected</td>
  </tr>
</table>
<br />


	
		<br />
	<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<a name="var$db" id="$db"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">mixed</span>&nbsp;&nbsp;
			<span class="var-name">$db</span>
						<span class="smalllinenumber">[line <a href="../../__filesource/fsource_QueryPath_Extension_srcQueryPathExtensionQPDB.php.html#a230">230</a>]</span>
		</span>
	</div>

		<strong>API Tags:</strong><br />
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="indent"><strong>Access:</strong>&nbsp;&nbsp;</td><td>protected</td>
  </tr>
</table>
<br />


	
		<br />
	<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<a name="var$dsn" id="$dsn"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">mixed</span>&nbsp;&nbsp;
			<span class="var-name">$dsn</span>
						<span class="smalllinenumber">[line <a href="../../__filesource/fsource_QueryPath_Extension_srcQueryPathExtensionQPDB.php.html#a229">229</a>]</span>
		</span>
	</div>

		<strong>API Tags:</strong><br />
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="indent"><strong>Access:</strong>&nbsp;&nbsp;</td><td>protected</td>
  </tr>
</table>
<br />


	
		<br />
	<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<a name="var$opts" id="$opts"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">mixed</span>&nbsp;&nbsp;
			<span class="var-name">$opts</span>
						<span class="smalllinenumber">[line <a href="../../__filesource/fsource_QueryPath_Extension_srcQueryPathExtensionQPDB.php.html#a231">231</a>]</span>
		</span>
	</div>

		<strong>API Tags:</strong><br />
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="indent"><strong>Access:</strong>&nbsp;&nbsp;</td><td>protected</td>
  </tr>
</table>
<br />


	
		<br />
	<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<a name="var$qp" id="$qp"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">mixed</span>&nbsp;&nbsp;
			<span class="var-name">$qp</span>
						<span class="smalllinenumber">[line <a href="../../__filesource/fsource_QueryPath_Extension_srcQueryPathExtensionQPDB.php.html#a228">228</a>]</span>
		</span>
	</div>

		<strong>API Tags:</strong><br />
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="indent"><strong>Access:</strong>&nbsp;&nbsp;</td><td>protected</td>
  </tr>
</table>
<br />


	
		<br />
	<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<a name="var$row" id="$row"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">mixed</span>&nbsp;&nbsp;
			<span class="var-name">$row</span>
			 = <span class="var-default"> NULL</span>			<span class="smalllinenumber">[line <a href="../../__filesource/fsource_QueryPath_Extension_srcQueryPathExtensionQPDB.php.html#a232">232</a>]</span>
		</span>
	</div>

		<strong>API Tags:</strong><br />
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="indent"><strong>Access:</strong>&nbsp;&nbsp;</td><td>protected</td>
  </tr>
</table>
<br />


	
		<br />
	<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<a name="var$stmt" id="$stmt"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">mixed</span>&nbsp;&nbsp;
			<span class="var-name">$stmt</span>
			 = <span class="var-default"> NULL</span>			<span class="smalllinenumber">[line <a href="../../__filesource/fsource_QueryPath_Extension_srcQueryPathExtensionQPDB.php.html#a233">233</a>]</span>
		</span>
	</div>

		<strong>API Tags:</strong><br />
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="indent"><strong>Access:</strong>&nbsp;&nbsp;</td><td>protected</td>
  </tr>
</table>
<br />


	
		<br />
	<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
		</div>
	</div>

	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Class Overview</a>
																		| <a href="#sec-var-summary">Property Summary</a> | <a href="#sec-vars">Properties Detail</a>
																	| <a href="#sec-method-summary">Method Summary</a> | <span class="disabled">Methods Detail</span>
					</div>
		<div class="info-box-body">
			<a name='method_detail'></a>
<a name="methodbaseDB" id="baseDB"><!-- --></a>
<div class="oddrow">

<div class="method-header">
	<span class="method-title">static method baseDB</span>&nbsp;&nbsp;<span class="smalllinenumber">[line <a href="../../__filesource/fsource_QueryPath_Extension_srcQueryPathExtensionQPDB.php.html#a272">272</a>]</span>
</div>
<br />

	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code-border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">&nbsp;
		<code>static void baseDB(
string
$dsn, [array
$options = array()]&nbsp;
)</code>
    </td></tr></table>
    </td></tr></table><br /></div>

	<p align="center" class="short-description"><strong>Create a new database instance for all QueryPath objects to share.
</strong></p>
<span class="description"><p>This method need be called only once. From there, other QPDB instances  will (by default) share the same database instance.</p><p>Normally, a DSN should be passed in. Username, password, and db params  are all passed in using the options array.</p><p>On rare occasions, it may be more fitting to pass in an existing database  connection (which must be a PDO object). In such cases, the $dsn  parameter can take a PDO object instead of a DSN string. The standard options  will be ignored, though.</p><p><strong>Warning:</strong> If you pass in a PDO object that is configured to NOT throw  exceptions, you will need to handle error checking differently.</p><p><strong>Remember to always use <a href="../../QueryPath/Extension/QPDB.html#methoddoneWithQuery">QPDB::doneWithQuery()</a> when you are done
 with a query. It gives PDO a chance to clean up open connections that may
 prevent other instances from accessing or modifying data.</strong></p></span>
			<strong>Parameters:</strong><br />
			<table border="0" cellspacing="0" cellpadding="0">
					<tr><td class="indent">
				<span class="var-type">string</span>&nbsp;&nbsp;</td>
				<td>
				<span class="var-name">$dsn:&nbsp;</span></td>
				<td>
				<span class="var-description"> The DSN of the database to connect to. You can also pass in a PDO object, which   will set the QPDB object's database to the one passed in.</span>			</td></tr>
					<tr><td class="indent">
				<span class="var-type">array</span>&nbsp;&nbsp;</td>
				<td>
				<span class="var-name">$options:&nbsp;</span></td>
				<td>
				<span class="var-description"> An array of configuration options. The following options are currently supported: <ul><li>username =&gt; (string)</li><li>password =&gt; (string)</li><li>db params =&gt; (array) These will be passed into the new PDO object.
    See the PDO documentation for a list of options. By default, the
    only flag set is PDO::ATTR_ERRMODE, which is set to
    PDO::ERRMODE_EXCEPTION.</li></ul></span>			</td></tr>
				</table>

	<br />
	
<strong>Information Tags:</strong><br />
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="indent"><strong>Throws:</strong>&nbsp;&nbsp;</td><td>PDOException   An exception may be thrown if the connection cannot be made.</td>
  </tr>
</table>

		
		<br />
	<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<a name="methodgetBaseDB" id="getBaseDB"><!-- --></a>
<div class="evenrow">

<div class="method-header">
	<span class="method-title">static method getBaseDB</span>&nbsp;&nbsp;<span class="smalllinenumber">[line <a href="../../__filesource/fsource_QueryPath_Extension_srcQueryPathExtensionQPDB.php.html#a294">294</a>]</span>
</div>
<br />

	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code-border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">&nbsp;
		<code>static void getBaseDB(
)</code>
    </td></tr></table>
    </td></tr></table><br /></div>

	<p align="center" class="short-description"><strong>This method may be used to share the connection with other,  non-QueryPath objects.
</strong></p>

	<br />
	

		
		<br />
	<div class="top">[ <a href="#top">Top</a> ]</div>
</div>

<a name="method__construct" id="__construct"><!-- --></a>
<div class="oddrow">

<div class="method-header">
	<span class="method-title">Constructor __construct</span>&nbsp;&nbsp;<span class="smalllinenumber">[line <a href="../../__filesource/fsource_QueryPath_Extension_srcQueryPathExtensionQPDB.php.html#a304">304</a>]</span>
</div>
<br />

	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code-border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">&nbsp;
		<code>QPDB __construct(
<a href="../../QueryPath/QueryPath.html">QueryPath</a>
$qp&nbsp;
)</code>
    </td></tr></table>
    </td></tr></table><br /></div>

	<p align="center" class="short-description"><strong>Construct a new QPDB object. This is usually done by QueryPath itself.
</strong></p>

			<strong>Parameters:</strong><br />
			<table border="0" cellspacing="0" cellpadding="0">
					<tr><td class="indent">
				<span class="var-type"><a href="../../QueryPath/QueryPath.html">QueryPath</a></span>&nbsp;&nbsp;</td>
				<td>
				<span class="var-name">$qp:&nbsp;</span></td>
				<td>
							</td></tr>
				</table>

	<br />
	<strong>API Tags:</strong><br />
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="indent"><strong>Access:</strong>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
<br />


				<hr class="separator" />
		<div class="notes">Implementation of:</div>
			<dl>
			<dt><a href="../../QueryPath/QueryPathExtension.html#method__construct">QueryPathExtension::__construct()</a></dt>
					</dl>
		
		<br />
	<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<a name="methodaddData" id="addData"><!-- --></a>
<div class="evenrow">

<div class="method-header">
	<span class="method-title">addData</span>&nbsp;&nbsp;<span class="smalllinenumber">[line <a href="../../__filesource/fsource_QueryPath_Extension_srcQueryPathExtensionQPDB.php.html#a555">555</a>]</span>
</div>
<br />

	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code-border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">&nbsp;
		<code>void addData(
mixed
$columnName, [string
$qpFunc = 'append'], [string
$wrap = NULL]&nbsp;
)</code>
    </td></tr></table>
    </td></tr></table><br /></div>

	<p align="center" class="short-description"><strong>This is the implementation behind the append/prepend and before/after methods.
</strong></p>

			<strong>Parameters:</strong><br />
			<table border="0" cellspacing="0" cellpadding="0">
					<tr><td class="indent">
				<span class="var-type">mixed</span>&nbsp;&nbsp;</td>
				<td>
				<span class="var-name">$columnName:&nbsp;</span></td>
				<td>
				<span class="var-description"> The name of the column whose data should be added to the currently selected   elements. This can be either a string or an array of strings.</span>			</td></tr>
					<tr><td class="indent">
				<span class="var-type">string</span>&nbsp;&nbsp;</td>
				<td>
				<span class="var-name">$qpFunc:&nbsp;</span></td>
				<td>
				<span class="var-description"> The name of the QueryPath function that should be executed to insert data   into the object.</span>			</td></tr>
					<tr><td class="indent">
				<span class="var-type">string</span>&nbsp;&nbsp;</td>
				<td>
				<span class="var-name">$wrap:&nbsp;</span></td>
				<td>
				<span class="var-description"> The HTML/XML markup that will be used to wrap around the column data before   the data is inserted into the QueryPath object.</span>			</td></tr>
				</table>

	<br />
	<strong>API Tags:</strong><br />
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="indent"><strong>Access:</strong>&nbsp;&nbsp;</td><td>protected</td>
  </tr>
</table>
<br />


		
		<br />
	<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<a name="methodappendColumn" id="appendColumn"><!-- --></a>
<div class="oddrow">

<div class="method-header">
	<span class="method-title">appendColumn</span>&nbsp;&nbsp;<span class="smalllinenumber">[line <a href="../../__filesource/fsource_QueryPath_Extension_srcQueryPathExtensionQPDB.php.html#a614">614</a>]</span>
</div>
<br />

	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code-border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">&nbsp;
		<code>void appendColumn(
mixed
$columnName, [string
$wrap = NULL]&nbsp;
)</code>
    </td></tr></table>
    </td></tr></table><br /></div>

	<p align="center" class="short-description"><strong>Append the data in the given column(s) to the QueryPath.
</strong></p>
<span class="description"><p>This appends data to every item in the current QueryPath. The data will  be retrieved from the database result, using $columnName as the key.</p></span>
			<strong>Parameters:</strong><br />
			<table border="0" cellspacing="0" cellpadding="0">
					<tr><td class="indent">
				<span class="var-type">mixed</span>&nbsp;&nbsp;</td>
				<td>
				<span class="var-name">$columnName:&nbsp;</span></td>
				<td>
				<span class="var-description"> Either a string or an array of strings. The value(s) here should match   one or more column headers from the current SQL <a href="../../QueryPath/Extension/QPDB.html#methodquery">query</a>'s results.</span>			</td></tr>
					<tr><td class="indent">
				<span class="var-type">string</span>&nbsp;&nbsp;</td>
				<td>
				<span class="var-name">$wrap:&nbsp;</span></td>
				<td>
				<span class="var-description"> IF this is supplied, then the value or values retrieved from the database   will be wrapped in this HTML/XML before being inserted into the QueryPath.</span>			</td></tr>
				</table>

	<br />
	<strong>API Tags:</strong><br />
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="indent"><strong>See:</strong>&nbsp;&nbsp;</td><td><a href="../../QueryPath/QueryPath.html#methodwrap">QueryPath::wrap()</a></td>
  </tr>
  <tr>
    <td class="indent"><strong>See:</strong>&nbsp;&nbsp;</td><td><a href="../../QueryPath/QueryPath.html#methodappend">QueryPath::append()</a></td>
  </tr>
  <tr>
    <td class="indent"><strong>Access:</strong>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
<br />


		
		<br />
	<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<a name="methodcolumnAfter" id="columnAfter"><!-- --></a>
<div class="evenrow">

<div class="method-header">
	<span class="method-title">columnAfter</span>&nbsp;&nbsp;<span class="smalllinenumber">[line <a href="../../__filesource/fsource_QueryPath_Extension_srcQueryPathExtensionQPDB.php.html#a672">672</a>]</span>
</div>
<br />

	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code-border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">&nbsp;
		<code>void columnAfter(
mixed
$columnName, [string
$wrap = NULL]&nbsp;
)</code>
    </td></tr></table>
    </td></tr></table><br /></div>

	<p align="center" class="short-description"><strong>Insert data from the given column(s) after each element in the QueryPath.
</strong></p>
<span class="description"><p>This inserts data from the given columns after each element in the QueryPath  object. IF HTML/XML is given in the $wrap parameter, then the column data  will be wrapped in that markup before being inserted into the QueryPath.</p></span>
			<strong>Parameters:</strong><br />
			<table border="0" cellspacing="0" cellpadding="0">
					<tr><td class="indent">
				<span class="var-type">mixed</span>&nbsp;&nbsp;</td>
				<td>
				<span class="var-name">$columnName:&nbsp;</span></td>
				<td>
				<span class="var-description"> Either a string or an array of strings. The value(s) here should match   one or more column headers from the current SQL <a href="../../QueryPath/Extension/QPDB.html#methodquery">query</a>'s results.</span>			</td></tr>
					<tr><td class="indent">
				<span class="var-type">string</span>&nbsp;&nbsp;</td>
				<td>
				<span class="var-name">$wrap:&nbsp;</span></td>
				<td>
				<span class="var-description"> IF this is supplied, then the value or values retrieved from the database   will be wrapped in this HTML/XML before being inserted into the QueryPath.</span>			</td></tr>
				</table>

	<br />
	<strong>API Tags:</strong><br />
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="indent"><strong>See:</strong>&nbsp;&nbsp;</td><td><a href="../../QueryPath/Extension/QPDB.html#methodappendColumn">QPDB::appendColumn()</a></td>
  </tr>
  <tr>
    <td class="indent"><strong>See:</strong>&nbsp;&nbsp;</td><td><a href="../../QueryPath/QueryPath.html#methodafter">QueryPath::after()</a></td>
  </tr>
  <tr>
    <td class="indent"><strong>See:</strong>&nbsp;&nbsp;</td><td><a href="../../QueryPath/QueryPath.html#methodwrap">QueryPath::wrap()</a></td>
  </tr>
  <tr>
    <td class="indent"><strong>Access:</strong>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
<br />


		
		<br />
	<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<a name="methodcolumnBefore" id="columnBefore"><!-- --></a>
<div class="oddrow">

<div class="method-header">
	<span class="method-title">columnBefore</span>&nbsp;&nbsp;<span class="smalllinenumber">[line <a href="../../__filesource/fsource_QueryPath_Extension_srcQueryPathExtensionQPDB.php.html#a651">651</a>]</span>
</div>
<br />

	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code-border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">&nbsp;
		<code>void columnBefore(
mixed
$columnName, [string
$wrap = NULL]&nbsp;
)</code>
    </td></tr></table>
    </td></tr></table><br /></div>

	<p align="center" class="short-description"><strong>Insert the data from the given column before each element in the QueryPath.
</strong></p>
<span class="description"><p>This inserts the data before each element in the currently matched QueryPath.</p></span>
			<strong>Parameters:</strong><br />
			<table border="0" cellspacing="0" cellpadding="0">
					<tr><td class="indent">
				<span class="var-type">mixed</span>&nbsp;&nbsp;</td>
				<td>
				<span class="var-name">$columnName:&nbsp;</span></td>
				<td>
				<span class="var-description"> Either a string or an array of strings. The value(s) here should match   one or more column headers from the current SQL <a href="../../QueryPath/Extension/QPDB.html#methodquery">query</a>'s results.</span>			</td></tr>
					<tr><td class="indent">
				<span class="var-type">string</span>&nbsp;&nbsp;</td>
				<td>
				<span class="var-name">$wrap:&nbsp;</span></td>
				<td>
				<span class="var-description"> IF this is supplied, then the value or values retrieved from the database   will be wrapped in this HTML/XML before being inserted into the QueryPath.</span>			</td></tr>
				</table>

	<br />
	<strong>API Tags:</strong><br />
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="indent"><strong>See:</strong>&nbsp;&nbsp;</td><td><a href="../../QueryPath/Extension/QPDB.html#methodprependColumn">QPDB::prependColumn()</a></td>
  </tr>
  <tr>
    <td class="indent"><strong>See:</strong>&nbsp;&nbsp;</td><td><a href="../../QueryPath/QueryPath.html#methodbefore">QueryPath::before()</a></td>
  </tr>
  <tr>
    <td class="indent"><strong>See:</strong>&nbsp;&nbsp;</td><td><a href="../../QueryPath/QueryPath.html#methodwrap">QueryPath::wrap()</a></td>
  </tr>
  <tr>
    <td class="indent"><strong>Access:</strong>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
<br />


		
		<br />
	<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<a name="methoddbInit" id="dbInit"><!-- --></a>
<div class="evenrow">

<div class="method-header">
	<span class="method-title">dbInit</span>&nbsp;&nbsp;<span class="smalllinenumber">[line <a href="../../__filesource/fsource_QueryPath_Extension_srcQueryPathExtensionQPDB.php.html#a343">343</a>]</span>
</div>
<br />

	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code-border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">&nbsp;
		<code><a href="../../QueryPath/QueryPath.html">QueryPath</a> dbInit(
string
$dsn, [array
$options = array()]&nbsp;
)</code>
    </td></tr></table>
    </td></tr></table><br /></div>

	<p align="center" class="short-description"><strong>Create a new connection to the database. Use the PDO DSN syntax for a  connection string.
</strong></p>
<span class="description"><p>This creates a database connection that will last for the duration of  the QueryPath object. This method ought to be used only in two cases: <ul><li>When you will only run a couple of queries during the life of the
   process.</li><li>When you need to connect to a database that will only be used for
   a few things.</li></ul> Otherwise, you should use QPDB::baseDB to configure a single  database connection that all of <a href="../../QueryPath/QueryPath.html">QueryPath</a> can share.</p><p><strong>Remember to always use <a href="../../QueryPath/Extension/QPDB.html#methoddoneWithQuery">QPDB::doneWithQuery()</a> when you are done
 with a query. It gives PDO a chance to clean up open connections that may
 prevent other instances from accessing or modifying data.</strong></p></span>
			<strong>Parameters:</strong><br />
			<table border="0" cellspacing="0" cellpadding="0">
					<tr><td class="indent">
				<span class="var-type">string</span>&nbsp;&nbsp;</td>
				<td>
				<span class="var-name">$dsn:&nbsp;</span></td>
				<td>
				<span class="var-description"> The PDO DSN connection string.</span>			</td></tr>
					<tr><td class="indent">
				<span class="var-type">array</span>&nbsp;&nbsp;</td>
				<td>
				<span class="var-name">$options:&nbsp;</span></td>
				<td>
				<span class="var-description"> Connection options. The following options are supported: <ul><li>username =&gt; (string)</li><li>password =&gt; (string)</li><li>db params =&gt; (array) These will be passed into the new PDO object.
    See the PDO documentation for a list of options. By default, the
    only flag set is PDO::ATTR_ERRMODE, which is set to
    PDO::ERRMODE_EXCEPTION.</li></ul></span>			</td></tr>
				</table>

	<br />
	<strong>API Tags:</strong><br />
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="indent"><strong>Return:</strong>&nbsp;&nbsp;</td><td>The QueryPath object.</td>
  </tr>
  <tr>
    <td class="indent"><strong>Access:</strong>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
<br />

<strong>Information Tags:</strong><br />
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="indent"><strong>Throws:</strong>&nbsp;&nbsp;</td><td>PDOException   The PDO library is configured to throw exceptions, so any of the   database functions may throw a PDOException.</td>
  </tr>
</table>

		
		<br />
	<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<a name="methoddoneWithQuery" id="doneWithQuery"><!-- --></a>
<div class="oddrow">

<div class="method-header">
	<span class="method-title">doneWithQuery</span>&nbsp;&nbsp;<span class="smalllinenumber">[line <a href="../../__filesource/fsource_QueryPath_Extension_srcQueryPathExtensionQPDB.php.html#a475">475</a>]</span>
</div>
<br />

	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code-border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">&nbsp;
		<code><a href="../../QueryPath/QueryPath.html">QueryPath</a> doneWithQuery(
)</code>
    </td></tr></table>
    </td></tr></table><br /></div>

	<p align="center" class="short-description"><strong>Free up resources when a query is no longer used.
</strong></p>
<span class="description"><p>This function should <em>always</em> be called when the database  results for a query are no longer needed. This frees up the  database cursor, discards the data, and resets resources for future  use.</p><p>If this method is not called, some PDO database drivers will not allow  subsequent queries, while others will keep tables in a locked state where  writes will not be allowed.</p></span>
	<br />
	<strong>API Tags:</strong><br />
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="indent"><strong>Return:</strong>&nbsp;&nbsp;</td><td>The QueryPath object.</td>
  </tr>
  <tr>
    <td class="indent"><strong>Access:</strong>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
<br />


		
		<br />
	<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<a name="methodexec" id="exec"><!-- --></a>
<div class="evenrow">

<div class="method-header">
	<span class="method-title">exec</span>&nbsp;&nbsp;<span class="smalllinenumber">[line <a href="../../__filesource/fsource_QueryPath_Extension_srcQueryPathExtensionQPDB.php.html#a498">498</a>]</span>
</div>
<br />

	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code-border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">&nbsp;
		<code>void exec(
string
$sql&nbsp;
)</code>
    </td></tr></table>
    </td></tr></table><br /></div>

	<p align="center" class="short-description"><strong>Execute a SQL query, but expect no value.
</strong></p>
<span class="description"><p>If your SQL query will have parameters, you are encouraged to  use <a href="../../QueryPath/Extension/QPDB.html#methodquery">query()</a>, which includes built-in SQL Injection  protection.</p></span>
			<strong>Parameters:</strong><br />
			<table border="0" cellspacing="0" cellpadding="0">
					<tr><td class="indent">
				<span class="var-type">string</span>&nbsp;&nbsp;</td>
				<td>
				<span class="var-name">$sql:&nbsp;</span></td>
				<td>
				<span class="var-description"> A SQL statement.</span>			</td></tr>
				</table>

	<br />
	<strong>API Tags:</strong><br />
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="indent"><strong>Access:</strong>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
<br />

<strong>Information Tags:</strong><br />
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="indent"><strong>Throws:</strong>&nbsp;&nbsp;</td><td>PDOException   An exception will be thrown if a query cannot be executed.</td>
  </tr>
</table>

		
		<br />
	<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<a name="methodgetStatement" id="getStatement"><!-- --></a>
<div class="oddrow">

<div class="method-header">
	<span class="method-title">getStatement</span>&nbsp;&nbsp;<span class="smalllinenumber">[line <a href="../../__filesource/fsource_QueryPath_Extension_srcQueryPathExtensionQPDB.php.html#a595">595</a>]</span>
</div>
<br />

	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code-border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">&nbsp;
		<code>PDOStatement getStatement(
)</code>
    </td></tr></table>
    </td></tr></table><br /></div>

	<p align="center" class="short-description"><strong>Get back the raw PDOStatement object after a query().
</strong></p>

	<br />
	<strong>API Tags:</strong><br />
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="indent"><strong>Return:</strong>&nbsp;&nbsp;</td><td>Return the PDO statement object. If this is called and no statement   has been executed (or the statement has already been cleaned up),   this will return NULL.</td>
  </tr>
  <tr>
    <td class="indent"><strong>Access:</strong>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
<br />


		
		<br />
	<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<a name="methodnextRow" id="nextRow"><!-- --></a>
<div class="evenrow">

<div class="method-header">
	<span class="method-title">nextRow</span>&nbsp;&nbsp;<span class="smalllinenumber">[line <a href="../../__filesource/fsource_QueryPath_Extension_srcQueryPathExtensionQPDB.php.html#a519">519</a>]</span>
</div>
<br />

	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code-border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">&nbsp;
		<code><a href="../../QueryPath/QueryPath.html">QueryPath</a> nextRow(
)</code>
    </td></tr></table>
    </td></tr></table><br /></div>

	<p align="center" class="short-description"><strong>Advance the query results row cursor.
</strong></p>
<span class="description"><p>In a result set where more than one row was returned, this will  move the pointer to the next row in the set.</p><p>The PDO library does not have a consistent way of determining how many  rows a result set has. The suggested technique is to first execute a  COUNT() SQL query and get the data from that.</p><p>The <a href="../../QueryPath/Extension/QPDB.html#methodwithEachRow">withEachRow()</a> method will begin at the next row after the  currently selected one.</p></span>
	<br />
	<strong>API Tags:</strong><br />
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="indent"><strong>Return:</strong>&nbsp;&nbsp;</td><td>The QueryPath object.</td>
  </tr>
  <tr>
    <td class="indent"><strong>Access:</strong>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
<br />


		
		<br />
	<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<a name="methodprependColumn" id="prependColumn"><!-- --></a>
<div class="oddrow">

<div class="method-header">
	<span class="method-title">prependColumn</span>&nbsp;&nbsp;<span class="smalllinenumber">[line <a href="../../__filesource/fsource_QueryPath_Extension_srcQueryPathExtensionQPDB.php.html#a632">632</a>]</span>
</div>
<br />

	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code-border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">&nbsp;
		<code>void prependColumn(
mixed
$columnName, [string
$wrap = NULL]&nbsp;
)</code>
    </td></tr></table>
    </td></tr></table><br /></div>

	<p align="center" class="short-description"><strong>Prepend the data from the given column into the QueryPath.
</strong></p>
<span class="description"><p>This takes the data from the given column(s) and inserts it into each  element currently found in the QueryPath.</p></span>
			<strong>Parameters:</strong><br />
			<table border="0" cellspacing="0" cellpadding="0">
					<tr><td class="indent">
				<span class="var-type">mixed</span>&nbsp;&nbsp;</td>
				<td>
				<span class="var-name">$columnName:&nbsp;</span></td>
				<td>
				<span class="var-description"> Either a string or an array of strings. The value(s) here should match   one or more column headers from the current SQL <a href="../../QueryPath/Extension/QPDB.html#methodquery">query</a>'s results.</span>			</td></tr>
					<tr><td class="indent">
				<span class="var-type">string</span>&nbsp;&nbsp;</td>
				<td>
				<span class="var-name">$wrap:&nbsp;</span></td>
				<td>
				<span class="var-description"> IF this is supplied, then the value or values retrieved from the database   will be wrapped in this HTML/XML before being inserted into the QueryPath.</span>			</td></tr>
				</table>

	<br />
	<strong>API Tags:</strong><br />
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="indent"><strong>See:</strong>&nbsp;&nbsp;</td><td><a href="../../QueryPath/QueryPath.html#methodwrap">QueryPath::wrap()</a></td>
  </tr>
  <tr>
    <td class="indent"><strong>See:</strong>&nbsp;&nbsp;</td><td><a href="../../QueryPath/QueryPath.html#methodprepend">QueryPath::prepend()</a></td>
  </tr>
  <tr>
    <td class="indent"><strong>Access:</strong>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
<br />


		
		<br />
	<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<a name="methodquery" id="query"><!-- --></a>
<div class="evenrow">

<div class="method-header">
	<span class="method-title">query</span>&nbsp;&nbsp;<span class="smalllinenumber">[line <a href="../../__filesource/fsource_QueryPath_Extension_srcQueryPathExtensionQPDB.php.html#a403">403</a>]</span>
</div>
<br />

	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code-border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">&nbsp;
		<code>void query(
string
$sql, [array
$args = array()]&nbsp;
)</code>
    </td></tr></table>
    </td></tr></table><br /></div>

	<p align="center" class="short-description"><strong>Execute a SQL query, and store the results.
</strong></p>
<span class="description"><p>This will execute a SQL query (as a prepared statement), and then store  the results internally for later use. The data can be iterated using  <a href="../../QueryPath/Extension/QPDB.html#methodnextRow">nextRow()</a>. QueryPath can also be instructed to do internal iteration  using the <a href="../../QueryPath/Extension/QPDB.html#methodwithEachRow">withEachRow()</a> method. Finally, on the occasion that the  statement itself is needed, <a href="../../QueryPath/Extension/QPDB.html#methodgetStatement">getStatement()</a> can be used.</p><p>Use this when you need to access the results of a query, or when the  parameter to a query should be escaped. If the query takes no external  parameters and does not return results, you may wish to use the  (ever so slightly faster) <a href="../../QueryPath/Extension/QPDB.html#methodexec">exec()</a> function instead.</p><p>Make sure you use <a href="../../QueryPath/Extension/QPDB.html#methoddoneWithQuery">doneWithQuery()</a> after finishing with the database  results returned by this method.</p><p><strong>Usage</strong></p><p>Here is a simple example:  <ol><li><div class="src-line">&nbsp;<span class="src-php">&lt;?php</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-id">QPQDB</span><span class="src-sym">::</span><span class="src-id">baseDB</span><span class="src-sym">(</span><span class="src-var">$someDSN</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$args&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">':something'&nbsp;</span>=&gt;&nbsp;<span class="src-str">'myColumn'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<a href="../../QueryPath/_src---QueryPath---QueryPath.php.html#functionqp">qp</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><a href="../../QueryPath/Extension/QPDB.html#methodquery">query</a><span class="src-sym">(</span><span class="src-str">'SELECT&nbsp;:something&nbsp;FROM&nbsp;foo'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$args</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><a href="../../QueryPath/Extension/QPDB.html#methoddoneWithQuery">doneWithQuery</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-php">?&gt;</span></div></li>
</ol></p><p>The above would execute the given query, substituting myColumn in place of  :something before executing the query The <a href="../../QueryPath/Extension/QPDB.html#methoddoneWithQuery">doneWithQuery()</a> method  indicates that we are not going to use the results for anything. This method  discards the results.</p><p>A more typical use of the query() function would involve inserting data  using <a href="../../QueryPath/Extension/QPDB.html#methodappendColumn">appendColumn()</a>, <a href="../../QueryPath/Extension/QPDB.html#methodprependColumn">prependColumn()</a>, <a href="../../QueryPath/Extension/QPDB.html#methodcolumnBefore">columnBefore()</a>,  or <a href="../../QueryPath/Extension/QPDB.html#methodcolumnAfter">columnAfter()</a>. See the main documentation for <a href="../../QueryPath/Extension/QPDB.html">QPDB</a> to view  a more realistic example.</p></span>
			<strong>Parameters:</strong><br />
			<table border="0" cellspacing="0" cellpadding="0">
					<tr><td class="indent">
				<span class="var-type">string</span>&nbsp;&nbsp;</td>
				<td>
				<span class="var-name">$sql:&nbsp;</span></td>
				<td>
				<span class="var-description"> The query to be executed.</span>			</td></tr>
					<tr><td class="indent">
				<span class="var-type">array</span>&nbsp;&nbsp;</td>
				<td>
				<span class="var-name">$args:&nbsp;</span></td>
				<td>
				<span class="var-description"> An associative array of substitutions to make.</span>			</td></tr>
				</table>

	<br />
	<strong>API Tags:</strong><br />
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="indent"><strong>Access:</strong>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
<br />

<strong>Information Tags:</strong><br />
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="indent"><strong>Throws:</strong>&nbsp;&nbsp;</td><td>PDOException   Throws an exception if the query cannot be executed.</td>
  </tr>
</table>

		
		<br />
	<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<a name="methodqueryInto" id="queryInto"><!-- --></a>
<div class="oddrow">

<div class="method-header">
	<span class="method-title">queryInto</span>&nbsp;&nbsp;<span class="smalllinenumber">[line <a href="../../__filesource/fsource_QueryPath_Extension_srcQueryPathExtensionQPDB.php.html#a442">442</a>]</span>
</div>
<br />

	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code-border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">&nbsp;
		<code>void queryInto(
string
$sql, [array
$args = array()], [mixed
$template = NULL]&nbsp;
)</code>
    </td></tr></table>
    </td></tr></table><br /></div>

	<p align="center" class="short-description"><strong>Query and append the results.
</strong></p>
<span class="description"><p>Run a query and inject the results directly into the  elements in the QueryPath object.</p><p>If the third argument is empty, the data will be inserted directly into  the QueryPath elements unaltered. However, if a template is provided in  the third parameter, the query data will be merged into that template  and then be added to each QueryPath element.</p><p>The template will be merged once for each row, even if no row data is  appended into the template.</p><p>A template is simply a piece of markup labeled for insertion of  data. See <a href="../../QueryPath/Extension/QPTPL.html">QPTPL</a> and <a href="../../QueryPath/Extension/_src---QueryPath---Extension---QPTPL.php.html">QPTPL.php</a> for more information.</p><p>Since this does not use a stanard <a href="../../QueryPath/Extension/QPDB.html#methodquery">query()</a>, there is no need  to call <a href="../../QueryPath/Extension/QPDB.html#methoddoneWithQuery">doneWithQuery()</a> after this method.</p></span>
			<strong>Parameters:</strong><br />
			<table border="0" cellspacing="0" cellpadding="0">
					<tr><td class="indent">
				<span class="var-type">string</span>&nbsp;&nbsp;</td>
				<td>
				<span class="var-name">$sql:&nbsp;</span></td>
				<td>
				<span class="var-description"> The SQL query to execute. In this context, the query is typically a   SELECT statement.</span>			</td></tr>
					<tr><td class="indent">
				<span class="var-type">array</span>&nbsp;&nbsp;</td>
				<td>
				<span class="var-name">$args:&nbsp;</span></td>
				<td>
				<span class="var-description"> An array of arguments to be substituted into the query. See <a href="../../QueryPath/Extension/QPDB.html#methodquery">query()</a>   for details.</span>			</td></tr>
					<tr><td class="indent">
				<span class="var-type">mixed</span>&nbsp;&nbsp;</td>
				<td>
				<span class="var-name">$template:&nbsp;</span></td>
				<td>
				<span class="var-description"> A template into which query results will be merged prior to being appended   into the QueryPath. For details on the template, see <a href="../../QueryPath/Extension/QPTPL.html#methodtpl">QPTPL::tpl()</a>.</span>			</td></tr>
				</table>

	<br />
	<strong>API Tags:</strong><br />
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="indent"><strong>See:</strong>&nbsp;&nbsp;</td><td><a href="../../QueryPath/Extension/QPDB.html#methodquery">QPDB::query()</a></td>
  </tr>
  <tr>
    <td class="indent"><strong>See:</strong>&nbsp;&nbsp;</td><td><a href="../../QueryPath/Extension/QPTPL.html#methodtpl">QPTPL::tpl()</a></td>
  </tr>
  <tr>
    <td class="indent"><strong>See:</strong>&nbsp;&nbsp;</td><td><a href="../../QueryPath/Extension/_src---QueryPath---Extension---QPTPL.php.html">QPTPL.php</a></td>
  </tr>
  <tr>
    <td class="indent"><strong>Access:</strong>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
<br />


		
		<br />
	<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
<a name="methodwithEachRow" id="withEachRow"><!-- --></a>
<div class="evenrow">

<div class="method-header">
	<span class="method-title">withEachRow</span>&nbsp;&nbsp;<span class="smalllinenumber">[line <a href="../../__filesource/fsource_QueryPath_Extension_srcQueryPathExtensionQPDB.php.html#a537">537</a>]</span>
</div>
<br />

	<div class="function">
    <table width="90%" border="0" cellspacing="0" cellpadding="1"><tr><td class="code-border">
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td class="code">&nbsp;
		<code><a href="../../QueryPath/QueryPath.html">QueryPath</a> withEachRow(
)</code>
    </td></tr></table>
    </td></tr></table><br /></div>

	<p align="center" class="short-description"><strong>Set the object to use each row, instead of only one row.
</strong></p>
<span class="description"><p>This is used primarily to instruct QPDB to iterate through all of the  rows when appending, prepending, inserting before, or inserting after.</p></span>
	<br />
	<strong>API Tags:</strong><br />
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="indent"><strong>Return:</strong>&nbsp;&nbsp;</td><td>The QueryPath object.</td>
  </tr>
  <tr>
    <td class="indent"><strong>See:</strong>&nbsp;&nbsp;</td><td><a href="../../QueryPath/Extension/QPDB.html#methodcolumnAfter">QPDB::columnAfter()</a></td>
  </tr>
  <tr>
    <td class="indent"><strong>See:</strong>&nbsp;&nbsp;</td><td><a href="../../QueryPath/Extension/QPDB.html#methodappendColumn">QPDB::appendColumn()</a></td>
  </tr>
  <tr>
    <td class="indent"><strong>See:</strong>&nbsp;&nbsp;</td><td><a href="../../QueryPath/Extension/QPDB.html#methodcolumnBefore">QPDB::columnBefore()</a></td>
  </tr>
  <tr>
    <td class="indent"><strong>See:</strong>&nbsp;&nbsp;</td><td><a href="../../QueryPath/Extension/QPDB.html#methodprependColumn">QPDB::prependColumn()</a></td>
  </tr>
  <tr>
    <td class="indent"><strong>Access:</strong>&nbsp;&nbsp;</td><td>public</td>
  </tr>
</table>
<br />


		
		<br />
	<div class="top">[ <a href="#top">Top</a> ]</div>
</div>
		</div>
	</div>


        <div class="credit">
		    <hr class="separator" />
		    Documentation generated on Thu, 19 Mar 2009 18:01:11 -0500 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.2</a>
	      </div>
      </td></tr></table>
    </td>
  </tr>
</table>

</body>
</html>